<template>
  <div>
    <h1>Login </h1>
    <el-button @click="login" >登录</el-button>
  </div>
</template>

<script>
  export default {
    methods: {
      async login() {
        // window.localStorage['isLogin'] = true

        let loginSuccess = await this.$store.dispatch('doLoginAsync', {
          username: 'xinglong.shi',
          password: 'abc123'
        })
        if (loginSuccess) {
          if (this.$route.query.redirect) {
            this.$router.push(this.$route.query.redirect)
          }
        }
      }
    },
  }
</script>

<style lang="scss" scoped>

</style>